package com.lieve.bpm.command.editor;

import java.util.LinkedList;

/**
 * @author sunyoboy
 * 2021/6/4
 */
public class ActiveObjectEngine {

    LinkedList<Command> commandList = new LinkedList<>();

    public void addCommand(Command command) {
        commandList.add(command);
    }

    public void run() {
        while (!commandList.isEmpty()) {
            Command command = commandList.getFirst();
            commandList.removeFirst();
            command.didIt();
            command.undo();
        }
    }
}
